package definite.Guide.Book.Chap01_02;

import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Timer;

public class TimerSample {

	public static void main(String[] args) {
		Runnable runner = new Runnable() {

			@Override
			public void run() {
				ActionListener actionListener = new ActionListener() {

					@Override
					public void actionPerformed(ActionEvent e) {
						System.out.println("Hello World Timer");
					}
				};

				Timer timer = new Timer(1000, actionListener);
				timer.start();
			}
		};
		EventQueue.invokeLater(runner);
	}

}
